
//
//  Target_Network.m
//  AFNetworking
//
//  Created by lc4y on 2018/2/15.
//

#import "Target_Network.h"
#import <YTKNetwork/YTKNetworkConfig.h>
#import "CYNetWorkGetRequest.h"
#import "CYNetworkPostRequest.h"
#import "CYNetWorkPostFileRequest.h"
#import "CYNetworkCommonArguments.h"

@implementation Target_Network

- (void)Action_configServerURL:(NSDictionary *)params {
    [YTKNetworkConfig sharedConfig].baseUrl = params[@"kCYNetworkServerURL"];
}

- (void)Action_configCommonArguments:(NSDictionary *)params {
    [[CYNetworkCommonArguments shareCommonArguments] addCommonArguments:params[@"kCYNetworkCommonArgu"] delegate:params[@"delegate"]];
}

- (void)Action_getDataFromServer:(NSDictionary *)params {
    [CYNetWorkGetRequest CYNetGetRequetWithURL:params[@"URL"] params:params[@"params"] complete:params[@"kCYNetworkRequest"]];
}

- (void)Action_postDataFromServer:(NSDictionary *)params {
    [CYNetworkPostRequest CYNetPostRequetWithURL:params[@"URL"] params:params[@"params"] complete:params[@"kCYNetworkRequest"]];
}

- (void)Action_postFileToServer:(NSDictionary *)params {
    [CYNetWorkPostFileRequest CYNetPostFileRequetWithURL:params[@"URL"] params:params[@"params"] fileData:params[@"fileData"] fileType:params[@"fileType"] name:params[@"name"] complete:params[@"kCYNetworkRequest"]];
}

@end
